const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
mongoose.Promise = global.Promise;

const Album = mongoose.model('Album', {
	name: String,
	imageList: [
		{
			path: String,
			createDate: Date
		}
	],
	createDate: Date
});

async function init(){
	await Album.remove();
	await Album.create([
		{
			name: '相册1',
			imageList: [
				{path: '/tmp/1.JPG'}
			]
		},
		{
			name: '相册2',
			imageList: [
				{path: '/tmp/2.jpg'}
			]
		},
		{
			name: 'xiang'
		}
	])
	console.log(await Album.find());
}
//init()
module.exports = Album;